package error;

import com.atguigu.Main;
import org.junit.jupiter.api.Test;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * Created by 小可乐$ on 2024/9/11$ 18:40$
 * description: 故障解决2：测试非持久化交换机和队列
 */
@SpringBootTest(classes = Main.class)
public class RabbitMQError02 {
    public static final String EXCHANGE_TRANSIENT = "exchange.transient.user";
    public static final String ROUTING_KEY_TRANSIENT = "user";

    @Autowired
    private RabbitTemplate rabbitTemplate;
    /***
     *
     */
    @Test
    public void Test(){
        rabbitTemplate.convertAndSend(EXCHANGE_TRANSIENT,ROUTING_KEY_TRANSIENT,"hello user02 ~~");
    }
}
